#include "Config.h"
#include "tinyxml.h"

CConfig::CConfig()
{
}


CConfig::~CConfig()
{
}

bool CConfig::LoadSetting()
{
	std::string strPath = GetAppPath();
	strPath += "MonitorChip.cfg";

	TiXmlDocument	doc;
	if (!doc.LoadFile(strPath.c_str()))
		return FALSE;

	TiXmlElement*	pRoot = doc.RootElement();
	if (NULL == pRoot)
		return FALSE;

	if (!MonChipCfgParser::XmlElement2MonChipConfig(pRoot, _cfg))
		return false;
	
	return true;
}